package com.pug.controller;

import com.pug.service.ProductService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 飞哥
 * @Title: 学相伴出品
 * @Description: 飞哥B站地址：https://space.bilibili.com/490711252
 * 记得关注和三连哦！
 * @Description: 我们有一个学习网站：https://www.kuangstudy.com
 * @date 2022-07-06$ 16:28$
 */
@Slf4j
@RestController
@RequiredArgsConstructor
public class ProductContorller {


    private final ProductService productService;

    @PostMapping("/deduct/{productId}/{count}")
    public boolean deduct(@PathVariable("productId") Long productId, @PathVariable("count") Integer count) {
        return productService.deduct(productId, count);
    }
}
